package com.kaoshi.test28;

import java.util.Scanner;

/**
 * @author xiyu
 * @version 1.0
 * @date 2025/3/25 11:00
 * @description
 */
public class Test {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        Dao dao = new Dao();
        while (true) {
            System.out.println("=========学生信息管理系统=========");
            System.out.println("1.查询所有学生\n" +
                    "2.添加学生\n" +
                    "3.修改学生信息\n" +
                    "4.删除学生信息\n" +
                    "5.年龄从小到大排序\n" +
                    "6.成绩从高到低\n" +
                    "7.退出系统");
            System.out.println("==========================");
            System.out.print("请输入菜单编号：(1-7):");
            int next = input.nextInt();
            switch (next){
                case 1:
                    dao.findAllstu();
                    break;
                case 2:
                    dao.addStudent();
                    break;
                case 3:
                    dao.editStuScore();
                    break;
                case 4:
                    dao.reStu();
                    break;
                case 5:
                    dao.sortAge();
                    break;
                case 6:
                    dao.sortScore();
                    break;
                case 7:
                    System.out.println("===========已退出=========");
                    return;
                default:
                    System.err.println("输入错误");
                    break;
            }
        }
    }
}
